<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
    /* 1. async关键字可以将一个普通函数变为Promise
        2.await 关键字可以获取promise的结果
        3，await仅仅在async函数中有效
     */
    
        async function getCat(){
            return "xx"
        }
        async function detail(){
            return "detail"
        }
        async function url(){
            return "url"
        }
        async function getRes(){
            var cat =await getCat()
            console.log(cat)
            var de=await detail();
            console.log(de)
            var ur=await url()
            console.log(ur)
        }
        getRes();
    </script>
</body>
</html>